home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / COMMUNIC / H191.ZIP / CA29-3.EXE / REMAP.DOC < prev    next >
Text File  |  1992-11-30  |  28KB  |  990 lines

  1. COM-AND Remap Script
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.           -------------------------------------------
  13.                 COM-AND Remap Script
  14.           Script based compiler for COM-AND remapping
  15.           -------------------------------------------
  16.  
  17.  
  18.  
  19.  
  20.     COM-AND, and the REMAP script are copyright 1992 by CABER Soft-
  21.     ware.  COM-AND is distributed freely and may be copied by anyone
  22.     for any number of machines, for purposes of evaluation.  The
  23.     author offers COM-AND and its accessory programs as "shareware".
  24.     If you USE the program after evaluating it, you MUST pay for it.
  25.  
  26.  
  27.  
  28.     The complete user license and registration information is to be
  29.     found in the file REGISTER.DOC.  Limitations on redistribution
  30.     of COM-AND are set out in the file VENDOR.DOC.    These two files
  31.     are included with the COM-AND program release.
  32.  
  33.  
  34.  
  35.                  CABER Software
  36.                  R. (Scott) McGinnis
  37.                  P.O. Box 3607 Mdse Mart
  38.                  Chicago, IL 60654-0607
  39.  
  40.                  GEnie, Delphi: TARTAN
  41.                  CIS .......... 73147,2665
  42.                  Internet ..... 73147.2665@compuserve.com
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. Version 1.2: 921012
  55.  
  56. COM-AND Remap Script
  57.  
  58.  
  59.                  Table of Contents
  60.                  -----------------
  61.  
  62. I.    Introduction  .............................................. page 1
  63.  
  64.     A. What is COM-AND ......................................... page 1
  65.     B. Terminal Emulation ...................................... page 1
  66.     C. The REMAP Script ........................................ page 1
  67.  
  68. II.    Running REMAP.CMD .......................................... page 2
  69.  
  70. III.    REMAP source files ......................................... page 3
  71.  
  72.     A. Comments ................................................ page 3
  73.     B. Section names ........................................... page 3
  74.     C. Redefinitions ........................................... page 3
  75.     D. Remapped keys within redefinitions ...................... page 5
  76.  
  77. IV.    DOORWAY Remaps ............................................. page 6
  78.  
  79. V.    Program Requirements ....................................... page 7
  80.  
  81. VI.    Program and Author Information    ............................ page 8
  82.  
  83.  
  84.                 Appendices
  85.                 ----------
  86.  
  87.  
  88. A.    File structures ............................................ page 9
  89.  
  90. B.    Syntax ..................................................... page 10
  91.  
  92. C.    Tokens ..................................................... page 11
  93.  
  94. D.    Unusual Remaps ............................................. page 12
  95.  
  96. E.    REMAPS.TXT (source file) ................................... page 13
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109. Version 1.2: 921012
  110.  
  111. COM-AND Remap Script                             Page   1
  112.  
  113.  
  114. I.    Introduction
  115.  
  116.  
  117.     A. What is COM-AND?
  118.  
  119.  
  120.        COM-AND for the IBM PC and compatibles is a communications program
  121.        for use by itself, or for use with several integrated accessory
  122.        programs (which themselves may be used independently of COM-AND).
  123.        COM-AND provides standard comm program functions:  a dialing
  124.        directory, macros, disk logging, binary and ASCII file transfers,
  125.        scripted execution and terminal emulation...
  126.  
  127.  
  128.     B. Terminal Emulation
  129.  
  130.        COM-AND supports terminal emulation through 'display emulation',
  131.        'translation', and 'keyboard remapping' functions.  These are
  132.        independent...  VT100 display emulation may be combined with the
  133.        VT100 keyboard remap supplied, or the display emulation may be
  134.        combined with a different remap (one constructed to a different
  135.        set of preferences).
  136.  
  137.  
  138.     C. The REMAP script
  139.  
  140.        The script REMAP.CMD is a compiler of sorts.  It defines 'codes'
  141.        for each key COM-AND can detect (COM-AND doesn't detect all keys)
  142.        and a simple syntax for their redefinition.    REMAP.CMD also
  143.        allows several redefinitions combined in one source file; each
  144.        set is given its own unique name.
  145.  
  146.  
  147.        This document discusses the function of the REMAP.CMD script,
  148.        and the syntax used in source files given to REMAP.CMD.
  149.  
  150.        If all this seems overly complex, or if you have questions about
  151.        COM-AND's terminal emulation, feel free to write the author.  I
  152.        am very interested in every reaction to COM-AND.
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164. Version 1.2: 921012
  165.  
  166. COM-AND Remap Script                             Page   2
  167.  
  168.  
  169. II.    Running REMAP.CMD
  170.  
  171.  
  172.     The REMAP script is invoked through COM-AND's script processor (F2).
  173.     When invoked, REMAP opens a window offering a menu of choices.    The
  174.     choices are:
  175.  
  176.  
  177.     1) Compile source into a new remap file (COM-AND.RMP)
  178.  
  179.        Compilation of a source file produces a new COM-AND.RMP file
  180.        for use by COM-AND.    The source file name is requested; when
  181.        the source file is opened it is scanned once for 'sections'.
  182.  
  183.        If the source file contains one or more 'sections' (i.e. NAME
  184.        commands) the section names are listed in a new window, and
  185.        one must be selected.
  186.  
  187.        When a source file contains no sections, or when a section has
  188.        been selected, a new window is opened and the compilation begins.
  189.        Lines of text are displayed within the new window as they are
  190.        processed.  Press ESC to pause the compilation.
  191.  
  192.     2) Syntax check a source file
  193.  
  194.        REMAP allows a syntax check as well as compile.  A syntax check
  195.        results in no change to the current COM-AND.RMP.
  196.  
  197.     3) Search for files (Alt-F)
  198.  
  199.        REMAP allows you to search for files using the Alt-F file
  200.        directory function of COM-AND.
  201.  
  202.     4) Edit a file
  203.  
  204.        REMAP allows you to invoke an editor on a source file (the syntax
  205.        for the invocation is assumed - you may wish to change it).    When
  206.        you exit the editor, you are returned to COM-AND and REMAP.
  207.  
  208.     5) Turn remap on (using current COM-AND.RMP map file)
  209.  
  210.     6) Turn remap off
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219. Version 1.2: 921012
  220.  
  221. COM-AND Remap Script                             Page   3
  222.  
  223.  
  224. III.    REMAP source files
  225.  
  226.  
  227.     REMAP expects an ASCII file as source for the compilation.  ASCII
  228.     files are prepared by text editors (e.g.  EDLIN).  Word processors
  229.     usually do not emit ASCII files...  if you wish to use a word pro-
  230.     cessor to prepare a source file for REMAP, be sure it gives you
  231.     ASCII output (often called non-document format).
  232.  
  233.  
  234.     [NOTE:    The REMAP script allows you to invoke a text editor or word
  235.     processor from within the script itself.  Modify the first line of
  236.     the script to declare the complete program name (e.g.  C:\PE.EXE).
  237.     If you leave it blank, REMAP queries for a program name.  The value
  238.     "INTERNAL" invokes COM-AND's internal editor.]
  239.  
  240.     [NOTE: FileMgr.CMD defaults to COM-AND's INTERNAL editor in its
  241.     distributed form, and after a failure to load the editor you specify
  242.     (if you change the script.  Please refer to the document CASCRIPT.
  243.     DOC for a discussion of this editor.]
  244.  
  245.     Lines of source to REMAP.CMD must be  limited in length to 80
  246.     characters. Source files contain three types of lines:
  247.  
  248.     A. Comments
  249.  
  250.        Comment lines are blank, or begin with ";" or "*".  They are
  251.        ignored by the compiler.
  252.  
  253.     B. Section names
  254.  
  255.        The source file may (optionally) be divided into several sections
  256.        through the inclusion of "NAME = ..." command lines.  REMAP scans
  257.        the file before compilation; if section names are found, a window
  258.        is opened and you are asked to select a section to compile.
  259.  
  260.     C. Redefinitions
  261.  
  262.        All other lines of a source file are redefinitions.    A redefin-
  263.        ition command declares a given key is redefined as another key
  264.        or keys.  For example:
  265.  
  266.        A = B    ; redefines the 'A' key as 'B'
  267.        0x1a = AltX    ; Redefines control-z (0x1a) as Alt-X
  268.        0x80 = F2 "remap.cmd!"
  269.  
  270.  
  271.  
  272.  
  273.  
  274. Version 1.2: 921012
  275.  
  276. COM-AND Remap Script                             Page   4
  277.  
  278.  
  279. III.    REMAP source files (continued)
  280.  
  281.  
  282.     C. Redefinitions (continued)
  283.  
  284.        The last example requires some explanation...  0x80 is 80 hex.
  285.        to get an 80 hex using the keyboard, press and hold the ALT key
  286.        while typing 1 2 8 on the numeric pad (128 decimal is 80 hex).
  287.  
  288.        The last example declares that when you type 80 hex (alt-1-2-8),
  289.        COM-AND sees F2, then the string "remap.cmd" then a carriage
  290.        return (the "!" at the end is a carriage return).
  291.  
  292.        You may declare a string using the usual conventions for macro
  293.        strings or may declare the keystrokes individually.    For example,
  294.  
  295.        0x80 = A B C CR    ; and
  296.        0x80 = "ABC!"        ; and
  297.        0x80 = "AB" CR       ; and
  298.        0x80 = "AB^M"
  299.  
  300.  
  301.        are equivalent strings.  The "CR" in the first example is a
  302.        carriage return token defined by REMAP.  The "!" in the second
  303.        example is transformed to a carriage return (to declare a "!"
  304.        itself, type "!!").  The "^M" in the fourth line is 'control-M",
  305.        another way to say carriage return (to declare "^" by itself,
  306.        enter it as "^^").
  307.  
  308.  
  309.        The left side of the equals must be a token defined by the remap
  310.        script - tokens are listed in Appendix B below, page 10.
  311.  
  312.  
  313.        The redefinition may be any one token or character or group of
  314.        characters and characters.  Blanks (" "), commas (",") and
  315.        semi-colons (";") must be declared within quotes - REMAP treats
  316.        those characters as delimiters.
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329. Version 1.2: 921012
  330.  
  331. COM-AND Remap Script                             Page   5
  332.  
  333.  
  334. III.    REMAP source files (continued)
  335.  
  336.  
  337.     D. Remapped keys within redefinitions
  338.  
  339.        The remapping routines of COM-AND perform remapping on remaps
  340.        themselves, with one exception.  Any redefinition longer than one
  341.        ASCII key or one function key is ITSELF subject to remapping.
  342.        For example:
  343.  
  344.        ^PgDn = PgDn     ; Remap COM-AND's download ftn to ^PgDn
  345.        PgDn = ^PgDn "1!"    ; Automatically select WXMODEM on PgDn
  346.  
  347.  
  348.        The second remap (the remap of the PgDn key) translates to the
  349.        sequence: PgDn (COM-AND's download select window), "1" and CR.
  350.        The ^PgDn is remapped itself to invoke PgDn when executed.
  351.  
  352.  
  353.        This rule is particularly important to recognize when remapping
  354.        COM-AND defined keys (such as PgDn, PgUp, F10, etc).  The new
  355.        sequence assigned to the key is most likely more than one key-
  356.        stroke (one ASCII key or one function key) in length...  and if
  357.        so, is subject to remapping itself.    Be aware!
  358.  
  359.  
  360.        The original function being remapped may be itself assigned to
  361.        another key (usually one not used by COM-AND or the remap).    To
  362.        avoid remapping of the remap the assignment MUST be limited to a
  363.        single key (one ASCII key or one function key).
  364.  
  365.  
  366.        The example above demonstrates: the first line, '^PgDn = PgDn',
  367.        declares Control-PgDn functions as the original COM-AND download
  368.        protocol select window.  As it is one keystroke (PgDn) in length
  369.        it is not remapped itself.  The second line, 'PgDn = ^PgDn "1!"'
  370.        declares that the PgDn key itself invokes the download selection
  371.        window, and select item #1.
  372.  
  373.  
  374.        One last note, had the second line above been written 'PgDn =
  375.        PgDn "1!"', the remap would be circular... and if allowed would
  376.        loop indefinitely.  The REMAP script prohibits simple circular
  377.        definitions.
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384. Version 1.2: 921012
  385.  
  386. COM-AND Remap Script                             Page   6
  387.  
  388.  
  389. IV.    DOORWAY Remaps
  390.  
  391.  
  392.     Considerable interest was expressed to the author about COM-AND 2.7's
  393.     use with the DOORWAY utility (and similar facilities).    DOORWAY is
  394.     a communications program for the PC making certain programs (not
  395.     graphics mode) or DOS available to a remote caller.  The host display
  396.     is transmitted to the remote caller in ANSI format, and received key-
  397.     strokes from the remote caller are made to appear (to the program, or
  398.     DOS) as if typed from the local keyboard.
  399.  
  400.  
  401.     The one problem with DOORWAY and DOORWAY-like functions is the set
  402.     of non-ANSI keys (e.g. F1-F10, Alt'd keys and so on).  On the remote
  403.     caller's PC, in COM-AND, function and Alt'd keys invoke special func-
  404.     tions - how to send them to the DOORWAY host?
  405.  
  406.  
  407.     A simple (but tedious) remap can be made to redefine COM-AND function
  408.     and Alt'd keys to transmitted sequences.  However, when the remap is
  409.     enabled, all special functions in COM-AND (tied to those function
  410.     and Alt'd keys) are disabled.
  411.  
  412.  
  413.     No matter...  with COM-AND version 2.7 this remap was used, and
  414.     used successfully, with DOORWAY.  One key was reserved for a remap
  415.     to toggle the remapping itself...  making it very usable.  [In one
  416.     case, the Alt-equal key was remapped to invoke a script to turn
  417.     remap ON if it was OFF, and OFF it is was ON.  All other function
  418.     and Alt'd keys were transformed into the two byte sequence required
  419.     by DOORWAY when the remap was enabled.]
  420.  
  421.  
  422.     With version 2.8, the Alt-hyphen combination toggles 'remote' mode.
  423.     In remote mode, function and Alt'd keys are transmitted to a DOORWAY
  424.     or DOORWAY-like utility.  Alt-hyphen serves as a toggle, making it
  425.     the one key NOT transmitted.  Should Alt-hyphen itself be needed by
  426.     the application, it may be transmitted through a script.
  427.  
  428.  
  429.     Remapping is needed to meet many needs.  However, innovations in the
  430.     use of COM-AND generally come from its user-base.  As the author be-
  431.     comes acquainted with the real world needs of his customers, COM-AND
  432.     is extended and improved.
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439. Version 1.2: 921012
  440.  
  441. COM-AND Remap Script                             Page   7
  442.  
  443.  
  444. V.    Program requirements
  445.  
  446.  
  447.     This program can only function on an IBM PC or DOS compatible
  448.     machine.  COM-AND does direct to screen buffer fetches and stores
  449.     (unless BIOS screen updates are directed using the /C switch or the
  450.     Alt-O options menu).
  451.  
  452.  
  453.     COM-AND is TopView aware even without the /C switch or Alt-O option.
  454.  
  455.  
  456.     COM-AND supports MDA, CGA, EGA and Hercules.  COM-AND uses a Micro-
  457.     soft Mouse if one is available...
  458.  
  459.  
  460.     COM-AND disk I/O is done through the 'Handle' oriented I/O routines
  461.     added to DOS 2.0.  Therefore DOS 2.0 is a minimum requirement.
  462.  
  463.  
  464.     COM-AND (Version 2.9) requires 277K for itself.  You need 384K to
  465.     take advantage of the DOS Gateway and to load accessories.
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494. Version 1.2: 921012
  495.  
  496. COM-AND Remap Script                             Page   8
  497.  
  498.  
  499. VI.    Author information
  500.  
  501.  
  502.     COM-AND was written using Microsoft Macro-Assembler.  The author
  503.     likes assembler.  Assembly language is an entirely appropriate
  504.     vehicle for some of the program, and a not-inappropriate vehicle
  505.     for the rest of it.  Everything, in moderation...
  506.  
  507.  
  508.     The author of this program is R. Scott McGinnis of Chicago, IL.
  509.     GEnie and Delphi ID:  TARTAN.  Comment and suggestions (and
  510.     criticism in moderation) are welcomed:
  511.  
  512.              CABER Software
  513.              R. (Scott) McGinnis
  514.              P.O. Box 3607 Mdse Mart
  515.              Chicago, IL 60654-0607
  516.  
  517.  
  518.     I thank my wife, Elizabeth, who I love dearly.
  519.  
  520.  
  521.     This script (Version 1.2) may be distributed freely (but it isn't a
  522.     whole lot of use without COM-AND).  Any improvements you suggest to
  523.     the author get attention...  errors reported are corrected.  COM-AND
  524.     is shareware.  If you USE COM-AND after a 30 day evaluation, you
  525.     MUST pay for it.  [Please read the file REGISTER.DOC.]
  526.  
  527.  
  528.     Most of the hardware names and software names in this document are
  529.     trademarks or trade names of specific manufacturers.
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549. Version 1.2: 921012
  550.  
  551. COM-AND Remap Script                             Page   9
  552.  
  553.  
  554. A.    File structures
  555.  
  556.     COM-AND.RMP            ; 768 bytes maximum
  557.  
  558.        Entries are structured:
  559.  
  560.       byte  0          1     2                 ...
  561.         +---------+---------+---/ /---+---/ /---+---/ /---+
  562.         ! Key     ! Length    ! Redefinition for length     !
  563.         +---------+---------+---/ /---+---/ /---+---/ /---+
  564.  
  565.         where 'key' refers to an ASCII key value
  566.  
  567.         or as:
  568.  
  569.       byte  0          1     2      3                   ...
  570.         +---------+---------+---------+---/ /---+---/ /---+---/ /---+
  571.         ! 0       ! Key    ! Length  ! Redefinition for length    !
  572.         +---------+---------+---------+---/ /---+---/ /---+---/ /---+
  573.  
  574.         where '0/key' refers to an extended scancode as defined by BIOS.
  575.  
  576.  
  577.         The table size is determined by the file's size.  Optionally,
  578.         0,0 in an entry's first two bytes end the table.
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604. Version 1.2: 921012                           Appendices
  605.  
  606. COM-AND Remap Script                             Page  10
  607.  
  608.  
  609. B.    Syntax
  610.  
  611.  
  612.     REMAP.CMD defines a simple language for remapping.  Special keys
  613.     (such as F1) are given 'names' (Function key F1 is 'F1').  A simple
  614.     syntax is defined to redefine any key COM-AND can detect (it cannot
  615.     detect all keys or key-combinations).  REMAP.CMD expects a source
  616.     file prepared with a text editor (like a script).  It compiles the
  617.     source file into COM-AND.RMP.
  618.  
  619.     Lines of source in REMAP.CMD must be limited to 80 characters.    The
  620.     script REMAP.CMD defines lines with three types of syntax.
  621.  
  622.     .  Comments: Comment lines are blank, or begin with ";" or "*"
  623.  
  624.     .  Sections: The source file can be divided into up to 15 sections
  625.              and separately compiled) with the in-line command:
  626.  
  627.              NAME = <name for display>
  628.  
  629.     .  Remaps:   Within a section, a remapping has the syntax:
  630.  
  631.              <token> = <newkey>
  632.  
  633.              The list of defined tokens is given below.  The <new-
  634.              key> operand has the form:
  635.  
  636.              (<token>!<char>!<str>!<num>) [(" "!"," <newkey>] [";"]
  637.  
  638.              where "(...)" indicates a mandatory choice, "!"
  639.              indicates 'or', and "[...]" indicates an optional
  640.              choice.  The final optional semi-colon allows in-line
  641.              comments following.  For example:
  642.  
  643.              F10 = F10
  644.              0x80 = F2 "remap.cmd!" ; Alt-1-2-8 (80 hex) invokes it
  645.  
  646.              <Char> denotes a single character (with exception of
  647.                 ";", " " and ",").
  648.              <Str>  denotes a double-quote delimited string.  Within
  649.                 strings, ^^ -> ^, !! -> !, `x -> x, and the rules
  650.                 for macro strings otherwise apply.
  651.              <Num>  denotes a hex numeric (e.g. 0x80).
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659. Version 1.2: 921012                           Appendices
  660.  
  661. COM-AND Remap Script                             Page  11
  662.  
  663.  
  664. C.    Tokens
  665.  
  666.  
  667.     Tokens defined in REMAP.CMD are:
  668.     ------------------------------------------------
  669.     Normal                    Shifted
  670.     --------------------------------------- --------
  671.     F1    CurL    CR    (any single    SF1
  672.     F2    CurR    BS     key: e.g. A,    SF2
  673.     F3    CurUp    BELL     case being    SF3
  674.     F4    CurDn    INS     significant)    SF4
  675.     F5    End    DEL            SF5
  676.     F6    Home    TAB    (any single    SF6
  677.     F7    PgDn        key in quotes:    SF7
  678.     F8    PgUp        e.g. "A", case  SF8
  679.     F9    Tab        significant)    SF9
  680.     F10    Esc                SF10
  681.             (decimal/hex numerics)    RevTab
  682.     -----------------------------------------------
  683.     Control
  684.     -----------------------------------------------
  685.     CF1    ^F1    ^A    ^K    ^U    ^PrtSc
  686.     CF2    ^F2    ^B    ^L    ^V    ^CurL
  687.     CF3    ^F3    ^C    ^M    ^W    ^CurR
  688.     CF4    ^F4    ^D    ^N    ^X    ^End
  689.     CF5    ^F5    ^E    ^O    ^Y    ^Home
  690.     CF6    ^F6    ^F    ^P    ^Z    ^PgDn
  691.     CF7    ^F7    ^G    ^Q    ^@    ^PgUp
  692.     CF8    ^F8    ^H    ^R    ^[
  693.     CF9    ^F9    ^I    ^S    ^\
  694.     CF10    ^F10    ^J    ^T    ^]
  695.     -----------------------------------------------
  696.     Alt'd
  697.     -----------------------------------------------
  698.     AF1    AltF1    AltA    AltK    AltU    Alt0 (not numeric pad)
  699.     AF2    AltF2    AltB    AltL    AltV    Alt1
  700.     AF3    AltF3    AltC    AltM    AltW    Alt2
  701.     AF4    AltF4    AltD    AltN    AltX    Alt3
  702.     AF5    AltF5    AltE    AltO    AltY    Alt4
  703.     AF6    AltF6    AltF    AltP    AltZ    Alt5
  704.     AF7    AltF7    AltG    AltQ        Alt6
  705.     AF8    AltF8    AltH    AltR        Alt7
  706.     AF9    AltF9    AltI    AltS    Alt-    Alt8
  707.     AF10    AltF10    AltJ    AltT    AltEq    Alt9
  708.     -----------------------------------------------
  709.     Other
  710.     -----------------------------------------------
  711.     FUNCTN (operand only... produces 0/0x80 for COM-AND TV950)
  712.     NULL   (Equivalent to Alt_NumericKeyPad_0)
  713.  
  714. Version 1.2: 921012                           Appendices
  715.  
  716. COM-AND Remap Script                             Page  12
  717.  
  718.  
  719. D.    Unusual Remaps
  720.  
  721.  
  722.     Keyboard remapping is not necessarily limited to terminal emulation.
  723.     Remaps may be used to replace COM-AND function keys with new (perhaps
  724.     different) functions altogether.
  725.  
  726.  
  727.     A remap may define a string to be executed by COM-AND (similar to
  728.     the way a macro key might be used).  The string may be text to
  729.     transmit, or any other function key.  For example:
  730.  
  731.         F10 = 255 "HELP" CR
  732.  
  733.     This remap says in effect:  When the F10 key is pressed, COM-AND
  734.     sees the character with value 255, the characters "H" "E" "L" "P"
  735.     and a CR.  255 as an ASCII character is documented in COM-AND.DOC
  736.     under Alt-M Macros.  The character 255 in COM-AND has the same
  737.     function as F2 (run a script), but does not pop up a window and
  738.     search the drive for all files *.CMD and *.ENF.  "HELP" would be
  739.     interpreted by the 255 function as a script name (either HELP.,
  740.     HELP.CMD or HELP.ENF on the default or COM-AND= subdirectory).
  741.     The CR causes the 255 function to execute the script named HELP.
  742.  
  743.  
  744.     So...  one might write one's own help script (see the help screens
  745.     in FILEMGR or LEARN), call it HELP.CMD, put it in the COM-AND=
  746.     subdir, and never see the author's idea of a HELP summary again.
  747.     It might be paginated, indexed, what-have-you.
  748.  
  749.  
  750.     Another use for the '255' key is the execution of single script
  751.     statements.  The remap:
  752.  
  753.         AltX = 255 ".BYE"
  754.  
  755.     remaps the Alt-X key to the subsequent characters.  however, when
  756.     Alt-X is pressed, instead of a script being executed named BYE, the
  757.     script statement BYE is executed.  The initial "." signals a script
  758.     statement for execution, instead of a script file name.  [By the
  759.     way, this remap avoids the carrier test and query on termination...]
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769. Version 1.2: 921012                           Appendices
  770.  
  771. COM-AND Remap Script                             Page  13
  772.  
  773.  
  774. E.    REMAPS.TXT (source file)
  775.  
  776.  
  777.     A sample source file, REMAPS.TXT, is supplied with this document.
  778.     It contains several sections, with appropriate names, for terminals
  779.     COM-AND supports (or would like to support!).  One section of the
  780.     file is presented here as an example:
  781.  
  782.     name = VT100
  783.     ;
  784.     ;    VT100 definitions
  785.     ;
  786.     DEL   = 0x7f                ; Character delete
  787.     CurUp = ESC [ 0x41            ; Cursor up
  788.     CurDn = ESC [ 0x42            ; Cursor down
  789.     CurL  = ESC [ 0x44            ; Cursor left
  790.     CurR  = ESC [ 0x43            ; Cursor right
  791.     Home  = ESC [ 0x48            ; Home cursor
  792.     End   = ESC [ 0x4b            ; Erase to end of line
  793.     ^PgDn = ESC [ 0x48 ESC [ " "  0x4A  ; Clear screen
  794.     ^PgUp = ESC [ 0x4D            ; Delete line
  795.     ^Home = ESC [ 0x4c            ; Insert line
  796.  
  797.     AF1   = ESC O q             ; Keypad application mode 1
  798.     AF2   = ESC O r             ; Keypad application mode 2
  799.     AF3   = ESC O s             ; Keypad application mode 3
  800.     AF4   = ESC O t             ; Keypad application mode 4
  801.     AF5   = ESC O u             ; Keypad application mode 5
  802.     AF6   = ESC O v             ; Keypad application mode 6
  803.     AF7   = ESC O w             ; Keypad application mode 7
  804.     AF8   = ESC O x             ; Keypad application mode 8
  805.     AF9   = ESC O y             ; Keypad application mode 9
  806.     AF10  = ESC O p             ; Keypad application mode 0
  807.  
  808.     CF10  = AF10                ; COM-AND uses AF10 as shell
  809.  
  810.     SF1   = ESC O 0x50            ; Program function 1 (PF1)
  811.     SF2   = ESC O 0x51            ; Program function 2 (PF2)
  812.     SF3   = ESC O 0x53            ; Program function 3 (PF3)
  813.     SF4   = ESC O 0x54            ; Program function 4 (PF4)
  814.  
  815.     SF5   = ESC O 0x6d            ; Keypad application mode dash
  816.     SF6   = ESC O 0x6c            ; Keypad application mode comma
  817.     SF7   = ESC O 0x4d            ; Keypad application mode enter
  818.     SF8   = ESC O 0x6e            ; Keypad application mode period
  819.  
  820.     Although each item is commented, a discussion of this remap (and
  821.     others in REMAPS.TXT) follows:
  822.  
  823.  
  824. Version 1.2: 921012                           Appendices
  825.  
  826. COM-AND Remap Script                             Page  14
  827.  
  828.  
  829. E.    REMAPS.TXT (continued)
  830.  
  831.  
  832.     When the VT100 (or VT100.CMD script) remap is used:
  833.  
  834.     .    The DEL key is character delete.
  835.     .    HOME homes the cursor.    END erases to end of line.
  836.  
  837.     .    Control-PgDn sends a clear-screen sequence to the host.
  838.     .    Control-PgUp sends a delete-line sequence to the host.
  839.     .    Control-Home sends a insert-line command to the host.
  840.  
  841.     .    Cursor up/down/left/right are defined as keystrokes sent to
  842.         the host.  COM-AND menu mode is therefore disabled under
  843.         this remap (you can't select/pulldown menu items).
  844.  
  845.     .    VT100 "Program function" (PF) keys 1-4 are transmitted using
  846.         Shift-F1 through Shift-F4.
  847.  
  848.     .    In "Keypad application mode":
  849.  
  850.         The "Keypad application" the 1-9 keys are transmitted using
  851.         Alt-F1 through Alt-F9.    Keypad application 0 is transmitted
  852.         using Alt-F10.
  853.  
  854.         The "Keypad application" dash (hyphen) is transmitted using
  855.         Shift-F5.  Similarly, comma, enter, and period are mapped
  856.         to Shift-F6 through Shift-F8 for this usage.
  857.  
  858.     .    COM-AND's shell-to-DOS becomes Control-F10 (Alt-F10 was used
  859.         for "Keypad application mode" 0).
  860.  
  861.     The specific host implementation will determine key usage.  For
  862.     example, your keyboard 'enter' key will function as you expect in
  863.     some cases... however, in other cases, you'll need to use Shift-F7.
  864.  
  865.     This remap is the same as that created by the script VT100.CMD
  866.     (included with this release), which enables VT100 display emulation
  867.     and VT100 keyboard mapping.
  868.  
  869.     REMAPS.TXT contains several other sections:  ANSI, VT52, and TTY,
  870.     which are also embodied in scripts to simply terminal emulation.
  871.     Although each item is commented in each of these remaps, a
  872.     discussion of ANSI, VT52, and TTY remaps follows:
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879. Version 1.2: 921012                           Appendices
  880.  
  881. COM-AND Remap Script                             Page  15
  882.  
  883.  
  884. E.    REMAPS.TXT (continued)
  885.  
  886.  
  887.     When the VT52 remap (or VT52.CMD script) is used:
  888.  
  889.     .    The DEL key is character delete.
  890.     .    HOME homes the cursor.    END erases to end of line.
  891.  
  892.     .    Control-PgDn sends a clear-screen sequence to the host.
  893.     .    Control-PgUp sends a delete-line sequence to the host.
  894.     .    Control-Home sends a insert-line command to the host.
  895.  
  896.     .    Cursor up/down/left/right are defined as keystrokes sent to
  897.         the host.  COM-AND menu mode is therefore disabled under
  898.         this remap (you can't select/pulldown menu items).
  899.  
  900.     .    VT52 "Program function" (PF) keys 1-2 are transmitted using
  901.         Alt-F1 and Alt-F2.  VT52 "Program function" (PF) keys 3-4
  902.         are transmitted using Shift-F1 and Shift-F2.
  903.  
  904.     .    In "Keypad application mode":
  905.  
  906.         The "Keypad application" the 1-9 keys are transmitted using
  907.         Alt'd and Shifted function keys.  The keys are:
  908.  
  909.         Alt-F7       =      Keypad application mode 1
  910.         Alt-F8       =      Keypad application mode 2
  911.         Shift-F7   =      Keypad application mode 3
  912.         Alt-F5       =      Keypad application mode 4
  913.         Alt-F6       =      Keypad application mode 5
  914.         Shift-F5   =      Keypad application mode 6
  915.         Alt-F3       =      Keypad application mode 7
  916.         Alt-F4       =      Keypad application mode 8
  917.         Shift-F3   =      Keypad application mode 9
  918.         Alt-F9       =      Keypad application mode 0
  919.         Alt-F10    =      Keypad application mode 0 (dup)
  920.  
  921.         The "Keypad application" dash (hyphen) is transmitted using
  922.         Control-F4.  Comma is transmitted using Control-F5.  Enter
  923.         and period in this mode are transmitted with Control-F8/9.
  924.  
  925.     .    COM-AND's shell-to-DOS becomes Control-F10 (Alt-F10 was used
  926.         as a duplicate for "Keypad application mode" 0).
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934. Version 1.2: 921012                           Appendices
  935.  
  936. COM-AND Remap Script                             Page  16
  937.  
  938.  
  939. E.    REMAPS.TXT (continued)
  940.  
  941.  
  942.     When the ANSI remap (or ANSI.CMD script) is used:
  943.  
  944.     .    The DEL key is character delete.
  945.     .    HOME homes the cursor.    END erases to end of line.
  946.  
  947.     .    Control-PgDn sends a clear-screen sequence to the host.
  948.     .    Control-PgUp sends a delete-line sequence to the host.
  949.     .    Control-Home sends a insert-line command to the host.
  950.  
  951.     .    Cursor up/down/left/right are defined as keystrokes sent to
  952.         the host.  COM-AND menu mode is therefore disabled under
  953.         this remap (you can't select/pulldown menu items).
  954.  
  955.     .    ANSI "Program function" (PF) keys 1-4 are transmitted using
  956.         Shift-F1 through Shift-F4.
  957.  
  958.     .    In "Keypad application mode":
  959.  
  960.         The "Keypad application" the 1-9 keys are transmitted using
  961.         Alt-F1 through Alt-F9.    Keypad application 0 is transmitted
  962.         using Alt-F10.
  963.  
  964.         The "Keypad application" dash (hyphen) is transmitted using
  965.         Shift-F5.  Similarly, comma, enter, and period are mapped
  966.         to Shift-F6 through Shift-F8 for this usage.
  967.  
  968.     .    COM-AND's shell-to-DOS becomes Control-F10 (Alt-F10 was used
  969.         as a duplicate for "Keypad application mode" 0).
  970.  
  971.  
  972.     When the TTY remap (or TTY.CMD script) is used:
  973.  
  974.     .    All keys revert to their IBM PC (COM-AND) usages.  Function
  975.         Alt'd keys are interpreted by COM-AND (and not transmitted
  976.         to the communicating host).
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989. Version 1.2: 921012                           Appendices
  990.